<?php
session_start();

class Panel extends MY_Controller{
	private $status = true;
	private $token = '';
	
	function __construct(){
		parent::__construct();
		Sys::loadLanguage($this->params['lang'],'panel');
	}
	
	public function index(){
		$this->carabiner->css('dev/style.css');
		$this->carabiner->css('dev/panel/style.css');
		$js	= array(
					array('dev/jquery.js'),
					array('dev/panel/general.js')
				);
		
		$this->carabiner->js($js);
		
		$this->params['lang_txt_seccion'] = $this->get_txt_seccion();

		$this->params['seo'] = array(
			'title' 		=> ''.Sys::$title_web,
			'description' 	=> ''
		);
		
		$this->load->view('interface/header',$this->params);
		$this->load->view('interface/panel/content',$this->params);
		$this->load->view('interface/panel/aside',$this->params);
		$this->load->view('interface/footer',$this->params);
	}
	
	public function films(){
		$this->carabiner->css('dev/style.css');
		$this->carabiner->css('dev/panel/style.css');
		$js	= array(
					array('dev/jquery.js'),
					array('dev/panel/general.js')
				);
		
		$this->carabiner->js($js);
		
		// var_dump($this->uri->segment(3));
		
		$opc_url = $this->uri->segment(3);

		switch ($opc_url) {
			case 'admin':
					echo 'admin';
			break;
			
			case 'add':
					echo 'add';
			break;
			
			default:
				
			break;
		}
		
		$this->params['lang_txt_seccion'] = $this->get_txt_seccion();
		$this->params['seo'] = array(
			'title' 		=> ''.Sys::$title_web,
			'description' 	=> ''
		);
		
		$this->load->view('interface/header',$this->params);
		$this->load->view('interface/panel/content',$this->params);
		
		$this->load->view('interface/panel/aside',$this->params);
		$this->load->view('interface/footer',$this->params);
	}
	
	private function films_add(){
		
	}
	
	private function get_txt_seccion(){
		$str1 = $this->uri->segment(2);
		$str2 = $this->uri->segment(3);
		
		if ($str1 && $str2)
			return lang('txt_seccion_'.$str1.'_'.$str2);
		else 
			return lang('txt_seccion_index');
			
	}
	
	
}
